package com.zkw.gra.dynamic

/**
 * Created by Administrator on 2016/4/11 0011.
 * 对属性的两种引用
 */
class ReferenceFieldMain {
    public count = 0

    public static void main(String[] args) {
        def refer = new ReferenceFieldMain()
        refer.count = 1
        assert refer.count == 1
        def fieldName = 'count'
        refer[fieldName] = 2
        assert refer[fieldName] ==2
    }
}
